<template>
	<view>
		<uv-navbar title="设置管理员" bg-color="#FFFFFF" :placeholder='true' leftIconSize="20px"
			leftIconColor="#313C56" :autoBack='true' titleStyle="font-size: 16px;font-weight: 500;color: #313c56;" />
		<uv-input v-model="searchKey" placeholder="搜索公司/团队/个人" placeholderStyle="color:#95A4B3;font-size:12px;"
			confirmType="search" :autoBlur="true" fontSize="12px" color="#333333" prefixIcon="search"
			prefixIconStyle="fongSize:14px; marginLeft: 12px; color:#313C56;" border="none" shape="circle"
			customStyle="background-color: #F3F5FB; height: 32px; marginLeft: 12px; marginRight: 12px; marginTop: 8px">
			<template v-slot:suffix>
				<view v-if="searching" class="flex-row-center" style="height: 32px; width: 32px;"
					@click="searchClear">
					<image src="../../static/searchClear.png" style="width: 16px; height: 16px;"></image>
				</view>
				<view v-else class="font-12 font-weight-regular flex-row-center tast_searchBtn" @click="searchTap">
					搜索
				</view>
			</template>
		</uv-input>
		<scroll-view :scroll-y="true" style="width: 100vw;" :style="{height: $uv.addUnit(scrollHeight)}">
			<view v-for="(item,index) in [1,1]" :key="index" class="flex-row flex-items-center" style="margin-top: 12px;">
				<image src="../../static/selected.png" style="width: 16px; height: 16px; margin-left: 16px;"></image>
				<view class="flex-column font-12 font-weight-regular" style="background-color: #F7F9FD; border-radius: 12px; padding: 14px; margin-left: 12px; width: calc(100vw - 88px); color: #6B7885; ">
					<view class="flex-row flex-items-center">
						<image src="../../static/logo.png" style="width: 40px; height: 40px; border-radius: 20px; min-width: 40px;"></image>
						<view class="flex-column" style="margin-left: 12px;">
							<view class="flex-row flex-items-center">
								<text class="font-14 font-weight-medium" style="color: #313C56;">冉俊</text>
								<image src="../../static/level.png" style="width: 18px; height: 18px; margin-left: 4px;"></image>
							</view>
							<view class="flex-row flex-wrap">
								<view v-for="(item,index) in ['Xmind', '产品圆形', 'Axure']" :key="index" class="label flex-row flex-items-center">
									{{ item }}
								</view>
							</view>
						</view>
					</view>
					<view class="uv-line-2" style="margin-top: 14px;">
						个人简介个人简介个人简介个人简介个人简介个人简介个人简介个人简介个人简介个人简介个人简介个人简介
					</view>
				</view>
			</view>
		</scroll-view>
		<view class="font-16 font-weight-regular flex-row-center"
			style="margin-top: 12px; margin-left: 36px; margin-right: 36px; height: 44px; border-radius: 22px; background-color: #EB7520; color: white;">
			提交
		</view>
		<toast ref="toast"></toast>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				searchKey: '',
				searching: false,
			}
		},
		computed: {
			statusBarHeight() {
				const sys = uni.$uv.sys()
				return sys.statusBarHeight
			},
			navbarHeight() {
				return this.statusBarHeight + 44
			},
			screenWidth() {
				const sys = uni.$uv.sys()
				return sys.windowWidth
			},
			pageHeight() {
				const sys = uni.$uv.sys()
				return sys.windowHeight - this.navbarHeight
			},
			scrollHeight() {
				return this.pageHeight - this.toolbarHeight - 50
			},
			toolbarHeight() {
				const sys = uni.$uv.sys()
				return sys.safeAreaInsets.bottom + 68
			}
		},
		methods: {
			/**
			 * 搜索按钮事件
			 */
			searchTap() {
				this.searching = true
				uni.hideKeyboard()
			},
			/**
			 * 搜索框清除按钮
			 */
			searchClear() {
				this.searching = false
				this.searchKey = ''
				uni.hideKeyboard()
			}
		}
	}
</script>

<style>
	page {
		background-color: white;
	}
	.label {
		padding-left: 8px;
		padding-right: 8px;
		height: 18px;
		background: #FFFFFF;
		border-radius: 9px;
		margin-right: 8px;
		margin-top: 4px;
	}
	.tast_searchBtn {
		margin-right: 4px;
		color: white;
		width: 48px;
		height: 24px;
		background: linear-gradient(119deg, #EB5C20 0%, #EB9A20 100%);
		border-radius: 12px;
		opacity: 1;
	}
</style>
